package com.sunwayhorizo.health.hl7.persistent;

import com.sunwayhorizo.health.hl7.persistent.pk.RimCoreEntyNameUsesPK;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
// @NamedQuery(name = "EntyNameUses.findAll", query =
// "select o from EntyNameUses o")
@Table(name = "RIM_CORE_ENTY_NAME_USES")
@IdClass(RimCoreEntyNameUsesPK.class)
public class RimCoreEntyNameUses implements Serializable {
	@Id
	@Column(name = "ENTITY_ID", nullable = false, insertable = false, updatable = false)
	private Long entityId;
	@Id
	@Column(name = "ENTITY_VERSION_NUM", nullable = false, insertable = false, updatable = false)
	private Long entityVersionNum;
	@Id
	@Column(name = "ENTITY_NAME_ID", nullable = false, insertable = false, updatable = false)
	private Long entityNameId;
	@Id
	@Column(name = "USE_CODE", nullable = false)
	private String use;

	@ManyToOne
	@JoinColumns({
			@JoinColumn(name = "ENTITY_ID", referencedColumnName = "ENTITY_ID"),
			@JoinColumn(name = "ENTITY_VERSION_NUM", referencedColumnName = "ENTITY_VERSION_NUM"),
			@JoinColumn(name = "ENTITY_NAME_ID", referencedColumnName = "ENTITY_NAME_ID") })
	private RimCoreEntyNames rimCoreEntyNames;

	public RimCoreEntyNameUses() {
	}

	public Long getEntityId() {
		return entityId;
	}

	public void setEntityId(Long entityId) {
		this.entityId = entityId;
	}

	public Long getEntityNameId() {
		return entityNameId;
	}

	public void setEntityNameId(Long entityNameId) {
		this.entityNameId = entityNameId;
	}

	public Long getEntityVersionNum() {
		return entityVersionNum;
	}

	public void setEntityVersionNum(Long entityVersionNum) {
		this.entityVersionNum = entityVersionNum;
	}

	public void setUse(String use) {
		this.use = use;
	}

	public String getUse() {
		return use;
	}

	public void setRimCoreEntyNames(RimCoreEntyNames rimCoreEntyNames) {
		this.rimCoreEntyNames = rimCoreEntyNames;
	}

	public RimCoreEntyNames getRimCoreEntyNames() {
		return rimCoreEntyNames;
	}
}
